﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DataAccessLibrary;

namespace BusinessLayer
{
    public class ClsLeave
    {
        public int EmployeeID { get; set; }
        public int NoOfLeave { get; set; }
        

        public void GetNoOfLeave(int intEmployeeID)
        {
            using (OleDataClient data = new OleDataClient())
            {
                DataTable dt = data.GetDataTable("Select * from AnnualLeave where EmployeeID=" + intEmployeeID.ToString(), "AnnualLeave");
                if (dt.Rows.Count > 0)
                {
                    EmployeeID = Convert.ToInt32(dt.Rows[0]["EmployeeID"]);
                    NoOfLeave = Convert.ToInt32(dt.Rows[0]["TotalLeave"]);
                }
            }
        }
       
        public void DeleteNoOfLeave()
        {
            using (OleDataClient data = new OleDataClient())
            {
                data.ExecuteNonQuery("Delete from  AnnualLeave where EmployeeID=" + EmployeeID.ToString());
            }
        }
    }
}
